<!DOCTYPE html>
<html>
<head>
    <title>修改配置</title>
    $css()


</head>
<body>
    <div class="form form2" id="form1" style="padding: 20px">
        <div class="title" style="margin-top: 0">
            <span class="icon icon1"></span>基本
        </div>
        <div class="fl hidden">
            <div class="label">
                <span class="red">*</span>授权用户：
            </div>
            <div class="in">
                <input type="text" class="tb_normal ui-box ui-validate" required="true" field="license_name" id="name" />
                <div class="tip">10字以下</div>
            </div>
        </div>
        <div class="fl">
            <div class="label">
                <span class="red">*</span>后台地址：
            </div>
            <div class="in">
                <b>http://<span field="site_domain"></span>/</b>
                <input type="text" class="tb_normal ui-box ui-validate" required="true" field="sys_admin_tag" regex="^[a-zA-Z0-9_-]{1,5}$" style="width: 60px" />
                <div class="red tip"> (*)修改后请通过新地址进入管理,需重启网站！</div>
            </div>
        </div>
        <div class="fl hidden">
            <div class="label">
                <span class="red">*</span>软件激活码：
            </div>
            <div class="in">
                <input type="text" class="tb_normal ui-box" field="license_key" style="width: 400px" />
                <div class="tip">10字以下</div>
            </div>
        </div>
        <div class="fl hidden">
            <div class="label">
                <span class="red">*</span>软件激活码：
            </div>
            <div class="in">
                <input type="text" class="tb_normal ui-box" field="license_key" style="width: 400px" />
            </div>
        </div>
       
        <div class="fl">
            <div class="label">调试模式：</div>
            <div class="in">
                <input type="checkbox" class="tb_normal ui-box" style="width: auto" field="opti_debug" />
                (建议不勾选)开启可查看详细的错误信息,设置网站会重启
            </div>
        </div>
        <div class="fl">
            <div class="label">原始名称上传：</div>
            <div class="in">
                <input type="checkbox" class="tb_normal ui-box" style="width: auto" field="sys_use_upload_raw_path" />
                上传文件使用本地文件的名称，不勾选将自动生成文件名
            </div>
        </div>
        <div class="fl">
            <div class="label">安全选项：</div>
            <div class="in">
                <input type="checkbox" class="tb_normal ui-box" style="width: auto" field="sys_encode_conf" id="sys_encode_conf" />
                <label for="sys_encode_conf">加密CMS配置文件</label>
            </div>
        </div>
        
        <div class="title" style="margin-top: 0">
            <span class="icon icon1"></span>SEO设置
        </div>
        <div class="fl">
            <div class="label">自动重定向：</div>
            <div class="in">
                <input type="radio" value="0" field="sys_www_rd" name="www_rd" id="www_rd_0" checked="checked" />
                <label for="www_rd_0">关闭</label>
                <input type="radio" value="1" field="sys_www_rd" name="www_rd" id="www_rd_1" />
                <label for="www_rd_1">定向到二级域名(www)</label>
                <input type="radio" value="2" field="sys_www_rd" name="www_rd" id="www_rd_2" />
                <label for="www_rd_2">二级(www)定向到顶级域名</label>
            </div>
        </div>

        <div class="fl">
            <div class="label">强制HTTPS：</div>
            <div class="in">
                <input type="radio" value="1" field="sys_force_https" name="force_https" id="force_https_1"/>
                <label for="force_https_1">开启</label>
                <input type="radio" value="0" field="sys_force_https" name="force_https" id="force_https_2" checked="checked"/>
                <label for="force_https_2">关闭</label>
            </div>
        </div>
        
        <div class="title" style="margin-top: 0">
            <span class="icon icon1"></span>性能
        </div>
        <div class="fl">
            <div class="label">静态服务器：</div>
            <div class="in">
                <input type="checkbox" class="tb_normal ui-box" style="width: auto" field="server_static_enabled" />
                &nbsp;&nbsp;CDN地址：http://<span field="server_static"></span>/
                <div>(建议开启,可提升访问速度)</div>
            </div>
        </div>
        <div class="fl">
            <div class="label">升级服务器：</div>
            <div class="in">
                <input type="text" class="tb_normal ui-box" field="server_upgrade" />
            </div>
        </div>
        <div class="fl">
            <div class="label">
                <span class="red">*</span>内存回收：
            </div>
            <div class="in">
                <input type="text" class="tb_normal ui-box ui-validate" required="true" isnumber="true" field="opti_gc_collect_interval" style="width: 80px" />分钟/次&nbsp;&nbsp;
                <div>(设置为0则不回收，修改重启网站后生效!)</div>
            </div>
        </div>
        <div class="fl">
            <div class="label">
                <span class="red">*</span>首页缓存：
            </div>
            <div class="in">
                <input type="text" class="tb_normal ui-box ui-validate" required="true" isnumber="true" field="perm_index_cache_second" style="width: 80px" />
                分钟(0表示不缓存)
            </div>
        </div>
        <div class="fl">
            <div class="label">
                <span class="red">*</span>客户端缓存：
            </div>
            <div class="in">
                <input type="text" class="tb_normal ui-box ui-validate" required="true" isnumber="true" field="opti_client_cache_seconds" style="width: 80px" />
                分钟(0表示不缓存)
            </div>
        </div>

        <div class="title" style="margin-top: 0">
            <span class="icon icon1"></span>数据库
        </div>
        <div class="fl">
            <div class="label">SQL跟踪：</div>
            <div class="in">
                <input type="checkbox" class="tb_normal ui-box" style="width: auto" field="sql_profile_trace" />
                将执行的sql记录到文件，文件存放路径为：/tmp/sql_profile.txt
            </div>
        </div>
        <dl class="hidden">
            <dt>数据表前缀:</dt>
            <dd>
                <input type="text" class="tb_normal ui-box ui-validate" required="true" field="db_prefix" style="width: 70px" />
                <span style="color: Red"> 请确保与数据库一致后修改，否则无法正常运行</span>
            </dd>
        </dl>

        <div class="title" style="margin-top: 0">
            <span class="icon icon1"></span>模板视图
        </div>
        <div class="fl">
            <div class="label">选项：</div>
            <div class="in">
                <input type="checkbox" id="ck_item_cache" class="tb_normal ui-box" style="width: auto" field="tpl_use_cache" />
                <label for="ck_item_cache">开启缓存(通过非网页改模板需关闭后生效)</label>&nbsp;
            </div>
        </div>
        <div class="fl">
            <div class="label">选项：</div>
            <div class="in">
                <input type="checkbox" id="ckitem1_1" class="tb_normal ui-box" style="width: auto" field="tpl_use_compress" />
                <label for="ckitem1_1">模板压缩</label>&nbsp;
                <input type="checkbox" id="ckitem1_2" class="tb_normal ui-box" style="width: auto" field="tpl_full_url_path" />
                <label for="ckitem1_2">完整路径(Full URL)</label>
            </div>
        </div>
        <div class="fl">
            <div class="label"></div>
            <div class="in">
                <span class="ui-button w100" id="btn_save">
                    <span class="button-inner">
                        <a href="javascript:;"></a>
                        <span class="button-txt">保存</span>
                    </span>
                </span>
            </div>
        </div>

        <div class="btnarea" style="padding-left: 58px; padding-top: 25px;">
        </div>
    </div>
</div>
    $js()
    <script type="text/javascript">
        cms.json.bind('form1',${json});
        window.saveData = function () {
            if (cms.validator.validate('form1')) {
                var data = cms.json.toObject('form1');
                data["xhr"] = 1;
                jr.xhr.jsonPost(location.href, data, function (json) {
                    if (json.result) {
                        showMsg2(json.message);
                    } else {
                        showErr(json.message,2000);
                    }
                });
            }
        };

        cms.$('btn_save').onclick = window.saveData;
    </script>

</body>
</html>
